{include file="/public/nheader" /}
<style>
    @media screen and (max-width: 600px) {
        .layui-col-xs6 {
            width: 100%;
        }
    }

    #dashboard .layui-sales {
        font-size: 22px;
    }
</style>
<!-- 正文开始 -->
<div id="dashboard" class="layui-fluid">
    <div class="layui-row layui-col-space10">
        <div class="layui-col-xs12 layui-col-sm10 layui-col-md12" style="color:red;">累计数据(每小时更新统计一次)</div>
        <div class="layui-col-xs6 layui-col-sm7 layui-col-md2">
            <!-- 填充内容 -->
            <div class="layui-card">
                <div class="layui-card-header">用户量/余额充值/会员购买<span
                        class="layui-badge layui-badge-blue pull-right">总</span></div>
                <div class="layui-card-body">
                    <div class="layui-sales">{$data.users.count}人/{$data.users.money}元/{$data.users.umoney}元</div>
                    <div class="layui-sales-info">
                        昨日增加 <span> {$data.users.yuser}人/{$data.users.ymoney}元/{$data.users.yumoney}元</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>今日增加{$data.users.tuser}人/{$data.users.tmoney}元/{$data.users.tumoney}元</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm7 layui-col-md2">
            <!-- 填充内容 -->
            <div class="layui-card">
                <div class="layui-card-header">交易额<span class="layui-badge layui-badge-blue pull-right">总</span></div>
                <div class="layui-card-body">
                    <div class="layui-sales">¥ {$data.alltotal.money}</div>
                    <div class="layui-sales-info">
                        昨日交易额 <span> ￥{$data.alltotal.ytotal}</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>今日交易额 ￥{$data.alltotal.ttotal}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm5 layui-col-md2">
            <div class="layui-card">
                <div class="layui-card-header">在线支付金额<span class="layui-badge layui-badge-blue pull-right">总</span>
                </div>
                <div class="layui-card-body">
                    <div class="layui-sales"> ￥{$data.palltotal.money}</div>
                    <div class="layui-sales-info">
                        线下支付<span> ￥{$data.palltotal.money1}</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>今日在线支付 ￥{$data.palltotal.ttotal}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm5 layui-col-md2">
            <div class="layui-card">
                <div class="layui-card-header">下单数量/下单用户<span class="layui-badge layui-badge-green pull-right">总</span>
                </div>
                <div class="layui-card-body">
                    <div class="layui-sales">{$data.ordercount.count}单/{$data.ordercount.scount}人</div>
                    <div class="layui-sales-info">
                        昨日下单<span> {$data.ordercount.ycount}单/{$data.ordercount.sycount}人</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>今日下单 {$data.ordercount.tcount}单/{$data.ordercount.stcount}人</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm5 layui-col-md2">
            <div class="layui-card">
                <div class="layui-card-header">待服务数量<span class="layui-badge layui-badge-green pull-right">总</span>
                </div>
                <div class="layui-card-body">
                    <div class="layui-sales">{$data.orderd.count}单</div>
                    <div class="layui-sales-info">
                        累计待服务金额<span> ￥{$data.orderd.total}(线上金额:{$data.orderd.totals|default=0})</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>今日待服务金额 ￥{$data.orderd.ttotal}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm5 layui-col-md2">
            <div class="layui-card">
                <div class="layui-card-header">服务中数量<span class="layui-badge layui-badge-green pull-right">总</span>
                </div>
                <div class="layui-card-body">
                    <div class="layui-sales">{$data.ordering.count}单</div>
                    <div class="layui-sales-info">
                        服务中待结算金额<span> ￥{$data.ordering.total}</span>
                        <fieldset class="layui-elem-field layui-field-title"></fieldset>
                        <div>线上待结算金额 ￥{$data.ordering.totals}</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm7 layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    已提现和提现中金额累计￥{$data.agenting.withdraw|default='0'},代理未结算金额累计￥{$data.agenting.total|default='0'},代理卡券需要向平台缴纳￥{$data.agenting.jiaona|default='0'}，代理卡券扣除未使用卡券实际需要向平台缴纳￥{$data.agenting.btmoneyt|default='0'}
                </div>
            </div>
        </div>
        <div class="layui-col-xs6 layui-col-sm7 layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header" style="color:red;">自助查询(实时数据)</div>
                <div class="layui-card-body">
                    <div class="layui-form">
                        <div class="layui-form-item">
                            <input type="hidden" value="1" name="chaxun" />
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <input type="text" name="created[startime]" autocomplete="off" lay-datetime=""
                                        class="layui-input" placeholder="开始时间,不填默认当前时间">
                                </div>
                                <div class="layui-form-mid">-</div>
                                <div class="layui-input-inline ">
                                    <input type="text" name="created[endtime]" autocomplete="off" lay-datetime=""
                                        class="layui-input" placeholder="结束时间,不填默认当前时间">
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="status" lay-verify="">
                                        <option value="">状态</option>
                                        <option value="2" {if !empty(input('get.status')) &&
                                            input('get.status')==2}selected{/if}>待接单</option>
                                        <option value="3" {if !empty(input('get.status')) &&
                                            input('get.status')==3}selected{/if}>服务中</option>
                                        <option value="4" {if !empty(input('get.status')) &&
                                            input('get.status')==4}selected{/if}>已服务</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="payment" lay-verify="">
                                        <option value="">支付方式</option>
                                        <option value="1" {if !empty(input('get.payment')) &&
                                            input('get.payment')==1}selected{/if}>线下支付</option>
                                        <option value="2" {if !empty(input('get.payment')) &&
                                            input('get.payment')==2}selected{/if}>微信支付</option>
                                        <option value="3" {if !empty(input('get.payment')) &&
                                            input('get.payment')==3}selected{/if}>抖音支付</option>
                                        <option value="4" {if !empty(input('get.payment')) &&
                                            input('get.payment')==4}selected{/if}>余额支付</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="agentid" lay-search>
                                        <option value="">请选择代理</option>
                                        {foreach $agent as $v}
                                        <option value="{$v.id}" {if !empty(input('get.agentid')) &&
                                            input('get.agentid')==$v.id}selected{/if}>{$v.nickname}({$v.accounts})
                                        </option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="riderid" lay-search>
                                        <option value="">请选择师傅</option>
                                        {foreach $rider as $v}
                                        <option value="{$v.id}" {if !empty(input('get.riderid')) &&
                                            input('get.riderid')==$v.id}selected{/if}>{$v.name}({$v.mobile})
                                        </option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="province" lay-filter="province">
                                        <option value="">请选择搜索省份</option>
                                        {foreach $province as $v}
                                        <option value="{$v.area_code}" {if !empty(input('get.province')) &&
                                            input('get.province')==$v.area_code}selected{/if}>{$v.name}</option>
                                        {/foreach}
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="city" lay-filter="city">
                                        <option value="">请选择搜索城市</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="area" lay-filter="area">
                                        <option value="">请选择搜索区域</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <select name="street" lay-filter="street">
                                        <option value="">请选择搜索街道</option>
                                    </select>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <div class="layui-input-inline ">
                                    <input name="title" class="layui-input" type="text" placeholder="ID|订单号|用户名|手机号" />
                                </div>
                            </div>
                            <div class="layui-inline">
                                <!-- // 默认搜索 -->
                                <button class="layui-btn icon-btn" lay-filter="formSearch" lay-submit>搜索</button>
                            </div>
                        </div>
                    </div>
                    <!-- // 创建数据实例 -->
                    <table id="lay-tableList" lay-filter="lay-tableList"></table>
                </div>
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>
</div>

<!-- js部分 -->
{include file="/public/nfooter" /}
<script>
    layui.use(['admin', 'layer', 'table', 'form'], function () {
        var admin = layui.admin;
        var layer = layui.layer;
        var table = layui.table;        // 表格
        var form = layui.form;
        /*
         * 初始化表格
        */
        var isTable = table.render({
            elem: "#lay-tableList"
            , url: "{:url()}"
            , size: 'lg'
            , page: false
            , loading: true
            , pagebar: false
            , cols: [[
                { field: 'count', width: 200, align: 'center', title: '订单总数量' },
                { field: 'ptotal', width: 200, align: 'center', title: '不优惠原价累计' },
                { field: 'total', width: 200, align: 'center', title: '最终成交累计' },
                { field: 'dptotal', width: 200, align: 'center', title: '会员减免累计金额' },
                { field: 'cmoney', width: 200, align: 'center', title: '抵扣优惠券累计金额' },
                { field: 'ccount', width: 200, align: 'center', title: '次数抵扣金额' },
            ]]
        })
    })
</script>